<?php include("admin-header.php"); ?>
<script type="text/javascript" src="<?php echo $base ?>/js/manage.js"></script>

<link href="<?php echo $base ?>/css/style.css" rel="stylesheet" type="text/css">
</head>


<body>


 <table width="679" cellpadding="10">
        <tr>
          <td colspan="3" class="styleLabel">Administration Tasks </td>
          </tr>

        <tr >
          <td><div id='addError' name='addError' class="style21"></div></td>
          <td>&nbsp;</td>
          <td><div id='editError' name='editError' class="style21"></td>
        </tr>
        <tr>
          <td width="296" height="109" class="styleTable">
		   <form action="success.php" method="post" name="Add">
		  		<h3>Add category</h3>
		  		<p>
				     <table width="348" height="158"class="styleTable">
       <tr>
         <td>&nbsp;&nbsp;Name:</td>
           <td >
               <input type="text" name="categoryName" id="categoryName" value="" />
             </td>
        </tr>
       <tr>
         <td>&nbsp;&nbsp;Description</td>
           <td >
             
          
                 <textarea name="categoryDescription" id="categoryDescription"></textarea>
            </td>
        </tr>
       <tr>
         <td height="30">&nbsp;&nbsp;Position</td>
         <td>
             <input type="text" name="categoryPosition" id="categoryPosition" value="" />
        </td>
       </tr>
	   <tr>
         <td height="27">&nbsp;&nbsp;Url</td>
         <td>
             <input type="text" name="categoryUrl" id="categoryUrl" value="" />
         </td>
       </tr>
       <tr>
        
           <td height="26" colspan="2">
             
             <div align="center" > 
               <input type="submit" onclick="return validate_addcategory()" name="addCategory" id="addCategory" value="Add" style="color:white;font-weight:bold;float:right;background-color:#1A6A96;width:80px;height:25px" />
             </div>
			 <input type="hidden" name="option" id="option" value="addCategory" />
			 </td>
        </tr>
     </table>
	          </p>

			</form>

			</td>
          <td width="17">&nbsp;</td>
          <td width="296" class="styleTable">
		  <form action="success.php" method="post" name="Edit">
		    <h3>Edit category</h3>
		    <p>
			<table width="348" height="140"class="styleTable">

       
				 <tr>
				 <td colspan="2">  
				   <div align="center">
					 <select name="editCategory" id="editCategory" onChange="populate();" style="width:100px" >
					   <option value="-1"> Select </option>
					   <?php
				 $arr = DAOFactory::getCategorymasterDAO()->queryAll();
					for($i=0;$i<count($arr);$i++){
					   $row = $arr[$i];
					   echo  '<option value = "' . $row->categoryMasterId . "@@@@" . $row->categoryName . "@@@@" . $row->categoryDescription . "@@@@" . $row->position . "@@@@" .  $row->url . '">' .$row->categoryName . "</option>";
					}

				 ?>
					 </select>
				   </div></td>
				 <tr>
				   <tr>
					 <td>&nbsp;&nbsp;Name:</td>
						 <td><input type="text" name="categoryName22" id="categoryName22" value="" /></td>
					  </tr>
				   <tr>
					 <td>&nbsp;&nbsp;Description</td>

						 <td><textarea name="categoryDescription22" id="categoryDescription22"></textarea></td>
					  </tr>
				   <tr>
					 <td>&nbsp;&nbsp;Position</td>

						 <td><input type="text" name="categoryPosition22" id="categoryPosition22" value="" /></td>
					  </tr>
				  <tr>
				 <td>&nbsp;&nbsp;Url</td>

					 <td><input type="text" name="categoryUrl22" id="categoryUrl22" value="" /></td>
				  </tr>
				   <tr>
						 <td colspan="2"><div align="center">
						 <input type="hidden" name="option" id="option" value="editCategory" />
						   <input type="submit" name="editCategoryButton" id="editCategoryButton" 
						   onclick="return validate_editcategory()"  value="Save" tyle="color:white;font-weight:bold;float:right;background-color:#1A6A96;width:80px;height:25px" />
						 </div>
						 
						 </form></td>
					  </tr>
				</table>
	   
	   </p>
		   
		    		  
		   
				</td>
        </tr>
        <tr >
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="142" class="styleTable">
		  <form action="success.php" method="post" name="Delete">
		    <h3>Delete categorie</h3>
		    	 <table width="348"  class="styleTable">
					   
						 <tr>
							 <td colspan="2"><div align="center">
							   <select name="select" id="select" style="width:100px">
								  <option value="-1"> Select </option>
								  <?php
						 $arr = DAOFactory::getCategorymasterDAO()->queryAll();
							for($i=0;$i<count($arr);$i++){
							   $row = $arr[$i];
							   echo  '<option value = "' . $row->categoryMasterId . "@@@@" . $row->categoryName . "@@@@" . $row->categoryDescription . "@@@@" . $row->position . '">' .$row->categoryName . "</option>";
							}

						 ?>
						</select>
						&nbsp;&nbsp;

						<input type="hidden" name="option" id="option" value="deleteCategory" />
						 <input type="submit" name="deleteText" id="deleteText" value="Delete" onclick="return validate_delcategory()"/>
								</div>	 
						</td>

						 
				   </table>
			</form>
				</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>


</div>
</form>
<?php include("footer.php"); ?>